package 正则表达式;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class WebURL {
	
	
	public static void main(String[] args) {
		
//		String url = "<href=http://www.cnblogs.com/caiyao/p/4085681.html> "
//				+"<href=http://www.cnblogs.com/adsada.html>";
//		String url = "javajave";
//		String reg = "(?<=(href=)[\"]?[\']?)[http://][^\\s\"\'\\?]*(www.cnblogs.com)[^\\s\"\'>]*";
//		String reg = "(?<=href=).*";
		
		String url = "http://www.cnblogs.com/caiyao/p/4085681.html";		
		String reg = "(http://)[^\\s\"\'\\?]*www";
		
		
		Pattern p = Pattern.compile(reg);
		
		Matcher m = p.matcher(url);
		
		while(m.find()){
			System.out.println(m.group());
		}
		
		
	}
}
